import {GetLangArray} from "./lang";

export interface OptionInfo{
    label:string,
    value:string
}

//FormatOptionLangs 传入一个值列表，获取其语言包并返回OptionInfo列表
export  function FormatOptionLangs(values: Array<string>): Array<OptionInfo> {
    let langArray =  GetLangArray(values)
    let res:Array<OptionInfo>=[]
    for (let i = 0; i < values.length; i++) {
        let item:OptionInfo={
            label:langArray[i],
            value:values[i]
        }
        res.push(item)
    }

    return res
}